package study06;

class Student1{
    String name;
    int age;
    Student1(String n, int a){
        name = n;
        age = a;
    }
    void speak(){
        System.out.println("我的名字是：" + name+ "," + "今年"+ age +"岁");
    }
}

/**
* @author GZQ
* @Date 2023/11/9
 */

public class Example02 {
    public static void main(String[] args) {
        Student1 s1 = new Student1("张三", 19);
        Student1 s2 = new Student1("李四", 20);
        Student1 s3 = s2;
        s1.speak();
        s2.speak();
        s3.speak();
    }
}
